Xbasic

TOP_RECORDS_LIST Function

Syntax

Record_List as C = top_records_list(C order ,N count [,C filter])

Arguments

order

Optional. Default = "" (record number order). A character order expression that sorts selected records.

count

A integer number, representing the number of the table's records to retrieve. Numeric

filter

Optional. Default = ".T." (All records). A character filter expression that evaluates to a logical value and selects records from the table.

Returns

Record_ListCharacter

A list of the record numbers from the current table.

Description

Gets the record numbers for the first "X" records in a DBF table matching the filter and order expression.

Discussion

The TOP_RECORDS_LIST() function returns a list of the record numbers from the current table of the first percent records as defined the Order_Expn and Filter_Expn arguments. This function should be run from an open layout.

Example

dim frm as P
frm = form.view("Customer Information")
? top_records_list("lastname", 10)
= "32 56 55 52 54 18 48 8 51 20"

See Also